<template>
  <div>
    <button @click="test">测试===</button>
    <button @click="getUser">获取</button>
  </div>
</template>

<script>
import { useStore } from 'vuex'
export default {
  setup () {
    const store = useStore()
    const test = () => {
      store.commit('user/setUserId')
    }
    const getUser = () => {
      console.log(store.state.user.profile.id)
    }
    return {
      test,
      getUser
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
